Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
Android Chrome adds unwanted ".txt" extension to downloaded files with non-conventional extensions (e.g. 3dxml)

In my client side javascript code, there is a blob that I need to download with a specific file extension (.3dxml => 3D design model file). For this, I create a hidden html "a" tag, link the blob url to this tag, and specify the intended filename with extension (e.g. xyz.3dxml). I then simulate a click event on this link. This works fine in windows desktop chrome browser. But in and Android Chrome browser, after downloading this file appears as "xyz.3dxml.txt". This issue does not occur if I use a more standard file extension (e.g. *.stl).

I use the following code. Please let me know if you have any suggestions/advice.

var blob = new Blob([bufferOut]);
var url = window.URL;
var objectURL = url.createObjectURL(blob); 
var doc = window.document;
var saveLink = doc.createElementNS("http://www.w3.org/1999/xhtml", "a");
saveLink.href = objectURL;
saveLink.download = "xyz.3dxml";
saveLink.type = 'application/octet-stream';
var event = doc.createEvent("MouseEvents");
event.initMouseEvent("click", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
saveLink.dispatchEvent(event);
url.revokeObjectURL(objectURL);
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!